package com.linq.cool.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.linq.cool.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @Author: yqlin
 * @Date: 2020/12/29 15:22
 * @Description: 字典元素表
 * @Version: 1.0.0
 */
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Data
@Accessors(chain = true)
@TableName(value = "sys_dict_item")
public class SysDictItem extends BaseEntity {


    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 字典id
     */
    @NotNull(message = "字典id不能为空")
    @TableField(value = "dict_id")
    private Long dictId;

    /**
     * 字典元素标签
     */
    @NotBlank(message = "字典元素标签不能为空")
    @Size(min = 0, max = 100, message = "字典元素标签长度不能超过100个字符")
    @TableField(value = "`label`")
    private String label;
    /**
     * 图片(有些东西是需要图片的)
     */
    @TableField(value = "img")
    private String img;

    /**
     * 字典元素键值
     */
    @NotBlank(message = "字典元素键值不能为空")
    @Size(min = 0, max = 100, message = "字典元素键值长度不能超过100个字符")
    @TableField(value = "`value`")
    private String value;

    /**
     * 字典元素样式属性（其他样式扩展）
     */
    @Size(min = 0, max = 100, message = "字典元素样式属性长度不能超过100个字符")
    @TableField(value = "css_class")
    private String cssClass;

    /**
     * 字典元素表格回显样式
     */
    @TableField(value = "list_class")
    private String listClass;

    /**
     * 字典元素是否默认（0否 1是）
     */
    @TableField(value = "is_default")
    private Integer isDefault;

    /**
     * 字典元素状态（0正常 1停用）
     */
    @TableField(value = "`status`")
    private Integer status;

    /**
     * 字典排序
     */
    @NotNull(message = "显示顺序不能为空")
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;
}